<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link href="assets/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="css/style.css"/>
    <link rel="stylesheet" href="assets/css/ace.min.css"/>
    <link rel="stylesheet" href="assets/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="Widget/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
    <link href="Widget/icheck/icheck.css" rel="stylesheet" type="text/css"/>
    <!--[if IE 7]>
    <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css"/>
    <![endif]-->
    <!--[if lte IE 8]>
    <link rel="stylesheet" href="assets/css/ace-ie.min.css"/>
    <![endif]-->
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/typeahead-bs2.min.js"></script>
    <!-- page specific plugin scripts -->
    <script src="assets/js/jquery.dataTables.min.js"></script>
    <script src="assets/js/jquery.dataTables.bootstrap.js"></script>
    <script type="text/javascript" src="js/H-ui.js"></script>
    <script type="text/javascript" src="js/H-ui.admin.js"></script>
    <script src="assets/layer/layer.js" type="text/javascript"></script>
    <script src="assets/laydate/laydate.js" type="text/javascript"></script>
    <script type="text/javascript" src="Widget/zTree/js/jquery.ztree.all-3.5.min.js"></script>
    <script src="js/lrtk.js" type="text/javascript"></script>
<title>短消息模板设置</title>

</head>

<body>
	
<div class="margin clearfix">
 <div class="stystems_style">
  <div class="tabbable">
  <div class="page-content clearfix">
    <div id="Member_Ratings">
      <div class="d_Confirm_Order_style">
	<ul class="nav nav-tabs" id="myTab">
	  <li class="active">
		<a data-toggle="tab" class="dropdown-toggle" href="#home"><i class="green fa fa-home bigger-110"></i>短消息模板设置</a></li>
		<li class="">
		<a data-toggle="tab" class="dropdown-toggle" href="#zdfs"><i class="green fa fa-home bigger-110"></i>自动发送短信设置</a></li>
	</ul>
	</div>
	<div class="tab-content">	
			
	 <div id="home" class="tab-pane active">					
	 <!---->
		<div class="border clearfix">
        <span class="l_f">
        <a href="javascript:ovid()" id="member_add" class="btn btn-warning"><i class="icon-plus"></i>新增短消息模板</a>
        <a href="javascript:ovid()" class="btn btn-danger"><i class="icon-trash"></i>批量删除</a>
		</span>
		</div>
		
         <table class="table table-striped table-bordered table-hover" id="sample-table">
		<thead>
		 <tr>
				<th width="25"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
				<th width="100">编号</th>
				<th width="150">模板名称</th>
				<th width="250">短信内容</th>
				<th width="200">操作</th>    
			</tr>
		</thead>
	<tbody>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0001</td>
          <td>验证码短信</td>
          <td>尊敬的XX，您好！为了保证您的安全，本次操作的验证码是XXXX，请在页面填写验证码完成验证，非常感谢您的支持与合作。</td>
          <td class="td-manage">
          <a title="编辑" onclick="member_edit('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0002</td>
          <td>收到下单通知</td>
          <td>尊敬的XX，您好！您的XXXX店铺有新的订单请求，请及时受理，如已处理，可忽略此提醒。</td>
          <td class="td-manage">
          <a title="编辑" onclick="member_edit('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0003</td>
          <td>发货通知</td>
          <td>尊敬的顾客，您好！您的订单号为XXXX的商品已经发货，请及时查收。</td>
          <td class="td-manage">
          <a title="编辑" onclick="member_edit('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0004</td>
          <td>退款通知</td>
          <td>尊敬的XX，您好！你有一笔退款交易申请，请在４８小时内尽快处理，非常感谢您的配合。</td>
          <td class="td-manage">
          <a title="编辑" onclick="member_edit('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0005</td>
          <td>顾客已支付</td>
          <td>尊敬的XX，您好！订单ＸＸＸ已支付。请尽快安排配送。</td>
          <td class="td-manage">
          <a title="编辑" onclick="member_edit('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0006</td>
          <td>已发货通知</td>
          <td>XXX您好，您的订单XXXX已成功提交，单号XXXX，我们会尽快为您发货。</td>
          <td class="td-manage">
          <a title="编辑" onclick="member_edit('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0007</td>
          <td>生日祝福</td>
          <td>在这个美丽的日子里，愿所有的鲜花为你盛开，所有的云朵为你飘洒，所有的轻风为你祈祷!朋友，在此时此刻，只想祝福你，生日快乐!平安一生!</td>
          <td class="td-manage">
          <a title="编辑" onclick="member_edit('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0008</td>
          <td>节日祝福1</td>
          <td>天空高远，也能尽数收入眼底;大海广阔，也能全部装进心里;路途遥远，也是漫漫总有归期;祝福平淡，也能装满浓浓情意。愿您事业高升一切如意!</td>
          <td class="td-manage">
          <a title="编辑" onclick="member_edit('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
      </tbody>
	</table>
</div>
<div id="zdfs" class="tab-pane">	

 <!---->
		<div class="border clearfix">
        <span class="l_f">
        <a href="javascript:ovid()" id="member_ad" class="btn btn-warning"><i class="icon-plus"></i>新增自动发送模板</a>
        <a href="javascript:ovid()" class="btn btn-danger"><i class="icon-trash"></i>批量删除</a>
		</span>
		</div>
		
         <table class="table table-striped table-bordered table-hover" id="1sample-table">
		<thead>
		 <tr>
				<th width="25"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
				<th width="100">编号</th>
				<th width="150">购买时间</th>
				<th width="150">发送时间</th>
				<th width="150">模板名称</th>
				<th width="150">短信内容</th>
				<th width="150">接收人</th>
				<th width="150">手机号</th>
				<th width="120">状态</th>
				<th width="200">操作</th>    
			</tr>
		</thead>
	<tbody>
		<tr>
		  <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td>
		  <td>0001</td>
		  <td>2012-06-15 12:45:12</td>
          <td>2012-12-15 12:45:12</td>
		  <td>保养提醒</td>
          <td>尊敬的XX，您好！您于XXXX年XX月XX日购买的XXX旭派电池，现保养时间已到,请到附近经销商处保养电池,非常感谢您的支持与合作。</td>
		  <td>张三</td>
		  <td>1888888888</td>
		  <td class="td-status"><span class="label label-success radius">已开启</span></td>
          <td class="td-manage">
		   <a onClick="member_stop(this,'10001')"  href="javascript:;" title="关闭"  class="btn btn-xs btn-success"><i class="icon-ok bigger-120"></i></a> 
          <a title="编辑" onclick="member_edi('550')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a> 
          <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
          </td>
		</tr>
      </tbody>
	</table>
</div>
</div>
	<!--添加模板图层-->
<div class="add_menber" id="add_menber_style" style="display:none">
    <ul class=" page-content">	
     <label class="label_name" >编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</label><span class="add_name"><input value="" name="编号" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >模板名称：</label><span class="add_name"><input value="" name="模板名称" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >短信内容：</label><span class="add_name"><textarea id="txtCon" rows="10" cols="50" name="短信内容"></textarea></span>
    </ul>
 </div>	
 <!--编辑模板图层-->
<div class="add_menber" id="add_menber_styl" style="display:none"> 
    <ul class=" page-content">	
      <label class="label_name" >编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</label><span class="add_name"><input value="0001" name="编号" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >模板名称：</label><span class="add_name"><input value="短信验证码" name="模板名称" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >短信内容：</label><span class="add_name"><textarea id="txtCon" rows="10" cols="50" name="短信内容"></textarea></span>
    </ul>
 </div>	
      	<!--添加模板2图层-->
<div class="add_menber" id="add_menber_sty" style="display:none">
    <ul class=" page-content">	
	 <label class="label_name" >购买时间：</label><span class="add_name"><input value="" name="购买时间" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >发送时间：</label><span class="add_name"><input value="" name="发送时间" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >模板名称：</label><span class="add_name"><input value="" name="模板名称" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >短信内容：</label><span class="add_name"><textarea id="txtCon" rows="10" cols="50" name="短信内容"></textarea></span><br/><br/>
	 <label class="label_name" >接收人：</label><span class="add_name"><input value="" name="接收人" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >手机号：</label><span class="add_name"><input value="" name="手机号" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name">状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态：</label><span class="add_name">
     <label><input name="form-field-radio1" type="radio" checked="checked" class="ace"><span class="lbl">开启</span></label>&nbsp;&nbsp;&nbsp;
     <label><input name="form-field-radio1"type="radio" class="ace"><span class="lbl">关闭</span></label></span>
	 </ul>
 </div>	
 <!--编辑模板2图层-->
<div class="add_menber" id="add_menber_st" style="display:none"> 
    <ul class=" page-content">	
<ul class=" page-content">	
	 <label class="label_name" >购买时间：</label><span class="add_name"><input value="2012-06-15 12:45:12" name="购买时间" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >发送时间：</label><span class="add_name"><input value="2012-12-15 12:45:12" name="发送时间" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >模板名称：</label><span class="add_name"><input value="保养提醒" name="模板名称" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >短信内容：</label><span class="add_name"><textarea id="txtCon" rows="10" cols="50" name="短信内容"></textarea></span><br/><br/>
	 <label class="label_name" >接收人：</label><span class="add_name"><input value="张三" name="接收人" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name" >手机号：</label><span class="add_name"><input value="18888888888" name="手机号" type="text"  class="text_add"/></span><br/><br/>
	 <label class="label_name">状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态：</label><span class="add_name">
     <label><input name="form-field-radio1" type="radio" checked="checked" class="ace"><span class="lbl">开启</span></label>&nbsp;&nbsp;&nbsp;
     <label><input name="form-field-radio1"type="radio" class="ace"><span class="lbl">关闭</span></label></span>
	 </ul>
    </ul>
 </div>	
 </div>
		</div>
		</div>
 </div>
</div>
</body>
</html>
<script>
jQuery(function($) {
	 var oTable1 = $('#sample-table').dataTable({
            "aaSorting": [[1, "desc"]],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [
                //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                {"orderable": false, "aTargets": [0]}// 制定列不参与排序
            ]
        });
		var oTable1 = $('#1sample-table').dataTable({
            "aaSorting": [[1, "desc"]],//默认第几个排序
            "bStateSave": true,//状态保存
            "aoColumnDefs": [
                //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                {"orderable": false, "aTargets": [0]}// 制定列不参与排序
            ]
        });
				
				
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});
			
			
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
/*模板-添加*/
 $('#member_add').on('click', function(){
    layer.open({
        type: 1,
        title: '新增模板',
		maxmin: true, 
		shadeClose: true, //点击遮罩关闭层
        area : ['800px' , ''],
        content:$('#add_menber_style'),
		btn:['确定','取消'],
		yes:function(index,layero){	
		 var num=0;
		 var str="";
     $(".add_menber input[type$='text']").each(function(n){
          if($(this).val()=="")
          {
               
			   layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
                title: '提示框',				
				icon:0,								
          }); 
		    num++;
            return false;            
          } 
		 });
		  if(num>0){  return false;}	 	
          else{
			  layer.alert('新增成功！',{
               title: '提示框',				
			icon:1,		
			  });
			   layer.close(index);	
		  }		  		     				
		}
    });
});

/*模板2-添加*/
 $('#member_ad').on('click', function(){
    layer.open({
        type: 1,
        title: '新增模板',
		maxmin: true, 
		shadeClose: true, //点击遮罩关闭层
        area : ['800px' , ''],
        content:$('#add_menber_sty'),
		btn:['确定','取消'],
		yes:function(index,layero){	
		 var num=0;
		 var str="";
     $(".add_menber input[type$='text']").each(function(n){
          if($(this).val()=="")
          {
               
			   layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
                title: '提示框',				
				icon:0,								
          }); 
		    num++;
            return false;            
          } 
		 });
		  if(num>0){  return false;}	 	
          else{
			  layer.alert('新增成功！',{
               title: '提示框',				
			icon:1,		
			  });
			   layer.close(index);	
		  }		  		     				
		}
    });
});

/*用户-关闭*/
function member_stop(obj,id){
	layer.confirm('确认要关闭吗？',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" class="btn btn-xs " onClick="member_start(this,id)" href="javascript:;" title="开启"><i class="icon-ok bigger-120"></i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已关闭</span>');
		$(obj).remove();
		layer.msg('已关闭!',{icon: 5,time:1000});
	});
}

/*用户-启用*/
function member_start(obj,id){
	layer.confirm('确认要开启吗？',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" class="btn btn-xs btn-success" onClick="member_stop(this,id)" href="javascript:;" title="关闭"><i class="icon-ok bigger-120"></i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已开启</span>');
		$(obj).remove();
		layer.msg('已开启!',{icon: 6,time:1000});
	});
}
/*模板-查看*/
function member_show(title,url,id,w,h){
	layer_show(title,url+'#?='+id,w,h);
}
/*模板-编辑*/
function member_edit(id){
	  layer.open({
        type: 1,
        title: '编辑模板',
		maxmin: true, 
		shadeClose:false, //点击遮罩关闭层
        area : ['800px' , ''],
        content:$('#add_menber_styl'),
		btn:['确认修改','取消'],
		yes:function(index,layero){	
		 var num=0;
		 var str="";
     $(".add_menber input[type$='text']").each(function(n){
          if($(this).val()=="")
          {
               
			   layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
                title: '提示框',				
				icon:0,								
          }); 
		    num++;
            return false;            
          } 
		 });
		  if(num>0){  return false;}	 	
          else{
			  layer.alert('修改成功！',{
               title: '提示框',				
			icon:1,		
			  });
			   layer.close(index);	
		  }		  		     				
		}
    });
}

/*模板2-编辑*/
function member_edi(id){
	  layer.open({
        type: 1,
        title: '编辑模板',
		maxmin: true, 
		shadeClose:false, //点击遮罩关闭层
        area : ['800px' , ''],
        content:$('#add_menber_st'),
		btn:['确认修改','取消'],
		yes:function(index,layero){	
		 var num=0;
		 var str="";
     $(".add_menber input[type$='text']").each(function(n){
          if($(this).val()=="")
          {
               
			   layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
                title: '提示框',				
				icon:0,								
          }); 
		    num++;
            return false;            
          } 
		 });
		  if(num>0){  return false;}	 	
          else{
			  layer.alert('修改成功！',{
               title: '提示框',				
			icon:1,		
			  });
			   layer.close(index);	
		  }		  		     				
		}
    });
}
/*模板-删除*/
function member_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
laydate({
    elem: '#start',
    event: 'focus' 
});
</script>
